﻿using LL.ERP.OA.Core.Views.UserControls;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Regions;
using System.Windows.Input;

namespace LL.ERP.OA.Core.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        private readonly IRegionManager _regionManager;

        private string _title = "这是第一个页面";
        public string Title
        {
            get { return _title; }
            set { SetProperty(ref _title, value); }
        }

        public MainWindowViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }

        /// <summary>
        /// 第一个按钮 Control
        /// </summary>
        public ICommand BtnCommand => new DelegateCommand<string>(regionName =>
        {
            _regionManager.RegisterViewWithRegion("ContentRegion", typeof(FirstUserControl));
        });
    }
}
